﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace JH
{
    /// <summary>
    ///  模糊匹配器基类
    /// </summary>
    public abstract class FuzzyMatcherBase:IDisposable
    {
        /// <summary>
        ///  添加字符串集合并提交
        /// </summary>
        public abstract void AddStringsAndCommit(IEnumerable<string> textArray);

        /// <summary>
        ///  异步添加字符串集合并提交
        /// </summary>
        public abstract Task AddStringsAndCommitAsync(IEnumerable<string> textEnumerable,
            CancellationToken token = default);

        /// <summary>
        ///  添加字符串并提交
        /// </summary>
        public abstract void AddStringAndCommit(string text);

        /// <summary>
        ///  匹配答案
        /// </summary>
        public abstract List<string> Search(string query, int maxResults = 10);

        public virtual void Dispose()
        {
        }
    }
}